<?php
include("session.php");
    include("Conexao.php");
    $conexao = new Conexao();
   
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    $nome = $_POST["nome"];
    
    
?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <LINK REL=StyleSheet HREF="main.css" TYPE="text/css" MEDIA=screen>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>   
        <link rel="stylesheet" href="main.css" />
    </head>
    <body>
        
        <?php if (!$nome){?>
        <form name="cadastroJogabilidade" action="indexAdmin.php?link=12" method="POST">
        
        <table border="0" style="border: 1px solid #ccc;">
            <thead>
                <tr>
                    <th colspan="2"><h3>Cadastro de Jogabilidade</h3></th>
                    
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>*Nome: </td>
                    <td><input required="true" type="text" name="nome" value="" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Enviar" name="cadastra" /> </td>
                    
                </tr>
            </tbody>
        </table>
    </form>
        <?}
        
        else {
            
            $con = $conexao->conectBD();
            
             
           // Prepare a query for execution
            $result = pg_prepare($con, "my_query", 'INSERT INTO tbJogabilidade_equipe05 (nome) VALUES ($1)');

            // Execute the prepared query.  Note that it is not necessary to escape
            // the string "Joe's Widgets" in any way
            $result = pg_execute($con, "my_query", array(strtoupper ( $_POST["nome"])));


           
           ?>
        DADOS CADASTRADOS COM SUCESSO </br>
        <table border="0"  align="center" >
                 <tbody>
                    <tr>
                        <td align="center"><a href="indexAdmin.php?link=11"><img src="images/icone_seta_voltar.png" width="50" height="50" alt="icone_seta_voltar"/> </br> VOLTAR</a>
                            </td>
                    </tr>
                </tbody>
            </table>

        <?}?>
    </body>
    
</html>
